-
Notifications
You must be signed in to change notification settings - Fork 106
feat: core deployment toolkit with tested RPC integration #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
* SafeAttribute supports in properties * Update Nep11Token.cs * Safe setters are not allowed
- Add DeploymentToolkit class with basic deployment API - Implement network configuration support (mainnet, testnet, local, custom RPC) - Add WIF key support for transaction signing - Create comprehensive project structure with interfaces and models - Add configuration management with JSON and environment variable support - Include 16 unit tests covering all basic functionality - Update README.md with deployment documentation and usage examples This establishes the foundation for Neo smart contract deployment capabilities without implementation details, providing a clean base for future enhancements.
…rence - Fix whitespace formatting issues in deployment toolkit files - Add missing final newlines to all source files - Remove duplicate Microsoft.NET.Test.Sdk package reference in test project - All 16 unit tests continue to pass - Code formatting now passes GitHub Actions checks
2f05ca7 to
ce28e18
Compare
ce28e18 to
ef94799
Compare
- Remove Network property from NetworkConfiguration as it depends on RpcUrl - Change NetworkMagic to nullable and retrieve from RPC when not configured - Add logic to fetch NetworkMagic from RPC using GetVersionAsync() - Remove unnecessary Compile Update section from csproj file - Update unit tests to match new behavior
- Add tests to verify network magic can be retrieved from RPC - Add tests for network configuration priority (specific > global > RPC) - Add tests for SetNetwork with various inputs and edge cases - Add tests to ensure proper RPC URL configuration for known networks - Document expected network magic values for mainnet and testnet
- Change testnet RPC URL from testnet1.neo.coz.io to testnet.rpc.ngd.network - Update all test assertions to use the new NGD testnet URL - Add integration tests to verify RPC connectivity (skipped by default) - Ensure network magic retrieval works with NGD testnet endpoint
- Change from testnet.rpc.ngd.network to testnet.ngd.network - Update all test assertions to use the correct URL
- Change testnet RPC URL to http://seed2t5.neo.org:20332 - Update all test assertions to use the Neo seed node URL - Update integration test names to reflect Neo testnet
vncoelho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Jim8y
My suggestion is that if this is able to Deploy and test, so, the examples we have here should be deployed during tests and we could verify states.
That would be a good test that has a real flow behind.
On the other hand, I see some separation between this repo and the framework being pushed here.
its hard to balance, smaller prs for easier to review, but lacks complete functionality, complete tookit too large for reviewing. yet if you wish to review as a whole, you can check the full pr. bellow is the deployed example contracts on testnet. Latest Deployment (TestNet)
Deployment Details:
|
|
I see @Jim8y, but why this needed to be here in Devpack? What I see in this pr is like a framework for interacting with the blockchain. |
Maybe even the Core itself is better than here |
implementing, testing, deploying is a complete workflow, with this, developer can do everfything easily all together. they dont need to download and install and sync neo-cli, or searching for some unknown deployment methods. All of these is for a better development experience. |
|
@shargon all your concern and suggestion have being resolved. |
| /// <summary> | ||
| /// Wallet configuration settings | ||
| /// </summary> | ||
| public class WalletConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One class per file please
tests/Neo.SmartContract.Deploy.UnitTests/RpcIntegrationTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Shargon <[email protected]>
…ffolding; add DeploymentArtifactsDemo example; fix RpcStore OnNewSnapshot; docs update
|
@Jim8y Could you solve the conflicts? |
…mples/Directory.Build.props and RpcStore; apply IsNullOrWhiteSpace in DeploymentArtifactsDemo
| public static NetworkProfile MainNet { get; } = new("mainnet", "https://mainnet1.neo.coz.io:443", 860833102, 0x35); | ||
| public static NetworkProfile TestNet { get; } = new("testnet", "http://seed2t5.neo.org:20332", 894710606, 0x35); | ||
| public static NetworkProfile Local { get; } = new("local", "http://localhost:50012"); | ||
| public static NetworkProfile Private { get; } = new("private", "http://localhost:50012"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the AddressVersion and NetworkMagic should be taken from an rpc request, we are not able to sign a different network by rpc
- README: document new signer hooks and standardise init param example - DeploymentArtifactsRequest.cs: add signer + custom transaction signer hooks - DeploymentOptions.cs: add signer provider, transaction signer plumbing
|
Thanks for the detailed write-up and examples. I still have a few blocking concerns before this can merge.
Happy to re-review once those items are resolved. |
Summary
This PR introduces a production-ready deployment toolkit for Neo smart contracts, complete with deterministic RPC shims and exhaustive unit coverage.
Highlights
DeploymentToolkitnow enforces safe RPC usage, confirmation policies, and state snapshotting for manifest-driven deployments.SetNetwork,ConfigureOptions,SetWifKey) with disposal/validation guards to prevent misuse.QueueRpcClientFactory,StubRpcClient) enabling hermetic tests without live RPC endpoints.Example Usage
Testing
dotnet test tests/Neo.SmartContract.Deploy.UnitTests/Neo.SmartContract.Deploy.UnitTests.csprojFollow-ups