https://github.com/sha3ns/solc_compiler_manager
solidity compiler
https://github.com/sha3ns/solc_compiler_manager
manager-system solc solidity
Last synced: 3 months ago
JSON representation
solidity compiler
- Host: GitHub
- URL: https://github.com/sha3ns/solc_compiler_manager
- Owner: Sha3nS
- Created: 2021-01-25T06:57:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T02:30:34.000Z (7 months ago)
- Last Synced: 2025-01-24T15:43:36.503Z (4 months ago)
- Topics: manager-system, solc, solidity
- Language: Go
- Homepage:
- Size: 16.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Provides solc download management and contract verification RPC service
## Installation
```
make install
```## Project Initialization
```
solc-compiler init --platform macosx-amd64/linux-amd64 -a
```Initialization requires specifying the project runtime platform. During initialization, you can specify whether to download all `solc` versions for the runtime platform.
You can reinitialize to override the current configuration. If file downloads fail during initialization, you can:
```
// Retry initialization - this process will automatically skip already downloaded compiler versionssolc-compiler init --platform macosx-amd64 -a
// Manually fetch a specific version using the executable
solc-compiler fetch v0.8.0
```## Managing Compiler Versions
```
// Download
solc-compiler fetch v0.8.0// Delete
solc-compiler delete v0.8.0
```## Compiling Solidity Files
```
solc-compiler compile --scope bin,abi,hashes --name Counter v0.5.11 [path_to_file] --optimize --optimize-runs 200 --evm-version "default"
--scope Specify compilation output content
--name Specify contract to compile
--optimize Specify whether to optimize compilation
--optimize-runs Specify optimization parameter
--evm-version Specify EVM version
For detailed parameters, please refer to the help documentation
```## Starting the RPC Server
```
solc-compiler rest-server
Provides the following endpoints:contract_ping: Heartbeat
curl --location --request POST 'http://127.0.0.1:1212' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "contract_ping",
"params": [],
"id": 1
}'contract_verify: Returns ABI and compiled binary hex string
curl --location --request POST 'http://127.0.0.1:1212' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "contract_verify",
"params": [
{
"name": "Test",
"compiler_version": "v0.5.11+commit.22be8592",
"code":"pragma solidity ^0.5.11; contract Test {}",
"optimize": false,
"optimize_runs": 0,
"evm_version": "default"
}
],
"id": 1
}'contract_listVersions: Returns supported compiler versions for the current platform
curl --location --request GET 'http://127.0.0.1:1212' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "contract_listVersions",
"params": [],
"id": 1
}'
```