{"id":19903259,"url":"https://github.com/nethereum/godot-example","last_synced_at":"2025-11-25T23:13:05.209Z","repository":{"id":40465790,"uuid":"486932891","full_name":"Nethereum/GoDot-Example","owner":"Nethereum","description":"GoDot integration example","archived":false,"fork":false,"pushed_at":"2022-05-06T15:04:38.000Z","size":12861,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T08:48:47.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ASP.NET","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nethereum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-29T10:36:47.000Z","updated_at":"2024-03-02T17:22:26.000Z","dependencies_parsed_at":"2022-08-09T21:20:12.049Z","dependency_job_id":null,"html_url":"https://github.com/Nethereum/GoDot-Example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nethereum/GoDot-Example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FGoDot-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FGoDot-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FGoDot-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FGoDot-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nethereum","download_url":"https://codeload.github.com/Nethereum/GoDot-Example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2FGoDot-Example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-25T02:00:05.816Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T20:22:50.555Z","updated_at":"2025-11-25T23:13:05.191Z","avatar_url":"https://github.com/Nethereum.png","language":"ASP.NET","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoDot Pong with C# with Nethereum Integration\n\nThe simple Pong game GoDot demo with Nethereum integration.\n\nThis demo demonstrates how to add Nethereum to a game using GoDot.\nCheck out the original demo on the godot asset library: https://godotengine.org/asset-library/asset/535\n\n## Usage\n\n+ Open the script project in Visual Studio or preferred IDE\n+ Add the Nethereum.Web3 Nuget \n\n\n## SSL Issues \n GoDot does not support TLS 1.3 (for example to connect to infura) so these are some workarounds (whilst not secure) to get you developing until then. \n There are other options to check for root certificates, but suffers similar issues on security as anyone can create a certificate with an issuer.\n \nAnother option is to trust the root certificate as provided as an example by @rohanrhu Evrensel Kişilik https://github.com/Nethereum/Nethereum/issues/811#issuecomment-1112141236\n \nTo work with normal Nethereum on your main script add the following\n\n```csharp\n public override async void _Ready()\n    {\n       ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;\n        ServicePointManager.ServerCertificateValidationCallback +=\n            (sender, certificate, chain, errors) =\u003e\n            {\n\n                if ((errors \u0026 (SslPolicyErrors.None)) \u003e 0)\n                {\n                    return true;\n                }\n\n                if (\n                    (errors \u0026 (SslPolicyErrors.RemoteCertificateNameMismatch)) \u003e 0 ||\n                    (errors \u0026 (SslPolicyErrors.RemoteCertificateNotAvailable)) \u003e 0\n                )\n                {\n                    return false;\n                }\n\n                return true;\n            };\n        ...\n\n```\n# SimpleGoDotRpcClient\nA custom Nethereum rpc client can be found in the source code which uses the GoDot HttpClient, this allows to work with http in html\nalthough this also does not support tls 3 and there is not work around as above.\n\nUsage:\n\n```csharp\n_simpleRpcClient = new SimpleGoDotRpcClient(new Uri(\"http://testchain.nethereum.com:8545\"), this);\nvar web3 = new Web3(_simpleRpcClient);\n```\n# Html Wasm issues and GoDot\nGoDot does not support multithreading in Wasm so this is limited to simple request / response. \n\n## Screenshots\n\n![Screenshot](screenshots/GoDotBlockNumberLocalhost1.gif)\n\n\n# Full sample Getting block number and displaying on the game\n\n```csharp\nusing Godot;\nusing System;\nusing System.Diagnostics;\nusing System.Net;\nusing System.Threading.Tasks;\nusing Nethereum.Web3;\n\npublic class Main : Node2D\n{\n\n    private Label blockNumberLabel;\n\n    // Called when the node enters the scene tree for the first time.\n    public override async void _Ready()\n    {\n        ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;\n        ServicePointManager.ServerCertificateValidationCallback +=\n            (sender, certificate, chain, errors) =\u003e\n            {\n\n                if ((errors \u0026 (SslPolicyErrors.None)) \u003e 0)\n                {\n                    return true;\n                }\n\n                if (\n                    (errors \u0026 (SslPolicyErrors.RemoteCertificateNameMismatch)) \u003e 0 ||\n                    (errors \u0026 (SslPolicyErrors.RemoteCertificateNotAvailable)) \u003e 0\n                )\n                {\n                    return false;\n                }\n\n                return true;\n            };\n        GetNode\u003cTimer\u003e(\"BlockNumberTimer\").Start();\n        blockNumberLabel = GetNode\u003cLabel\u003e(\"lblBlockNumber\");\n        await SetBlockNumber();\n    }\n\n    public async void OnBlockNumberTimerTimeout()\n    {\n        await SetBlockNumber();\n    }\n\n    public async Task SetBlockNumber()\n    {\n        //var web3 = new Web3(\"https://mainnet.infura.io/v3/yourProjectId\");\n        //Using localhost testnet\n        var web3 = new Web3();\n        var blockNumber = await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();\n        blockNumberLabel.Text = \"Block Number: \" + blockNumber.Value;\n    }\n}\n\n\n```\n\n# Thanks\nEvrensel Kişilik for first bringing me the attention to GoDot and second for the help in testing the different scenarios to check the ssl certifcates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fgodot-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnethereum%2Fgodot-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fgodot-example/lists"}