forked from stratisproject/StratisBitcoinFullNode
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add docker setup for testnet and main. - Add instructions on starting multiple instances. - Todo: Create a .bat file that launch everything with a single command, including docker build.
- Loading branch information
Showing
12 changed files
with
192 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM microsoft/dotnet:2.1-sdk | ||
|
||
RUN git clone https://github.com/CityChainFoundation/city-chain.git \ | ||
&& cd /city-chain/src/City.Chain \ | ||
&& dotnet build | ||
|
||
VOLUME /root/.citychain | ||
|
||
WORKDIR /city-chain/src/City.Chain | ||
|
||
COPY city.conf.docker /root/.citychain/city/CityTest/city.conf | ||
|
||
EXPOSE 24333 24334 24335 24336 | ||
|
||
CMD ["dotnet", "run", "-testnet"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
server=1 | ||
rpcbind=127.0.0.1 | ||
rpcallowip=127.0.0.1 | ||
testnet=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM microsoft/dotnet:2.1-sdk | ||
|
||
RUN git clone https://github.com/CityChainFoundation/city-chain.git \ | ||
&& cd /city-chain/src/City.Chain \ | ||
&& dotnet build | ||
|
||
VOLUME /root/.citychain | ||
|
||
WORKDIR /city-chain/src/City.Chain | ||
|
||
COPY city.conf.docker /root/.citychain/city/CityMain/city.conf | ||
|
||
EXPOSE 4333 4334 4335 4336 | ||
|
||
CMD ["dotnet", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
server=1 | ||
rpcbind=127.0.0.1 | ||
rpcallowip=127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# City Chain: Docker Setup | ||
|
||
Please first refer to the [README.md](README.md) for introduction to the Docker setup, then use this | ||
file for additional setup. | ||
|
||
## Run multiple instances as daemons | ||
|
||
docker run -d IMAGE | ||
docker run -d IMAGE | ||
|
||
## List running instances | ||
|
||
docker ps | ||
|
||
## Run a full local network with port forward: | ||
|
||
docker run -d -p 24333:24333 -p 24334:24334 -p 24335:24335 -p 24336:24336 IMAGE | ||
docker run -d -p 25333:24333 -p 25334:24334 -p 25335:24335 -p 25336:24336 IMAGE | ||
docker run -d -p 26333:24333 -p 26334:24334 -p 26335:24335 -p 26336:24336 IMAGE | ||
docker run -d -p 27333:24333 -p 27334:24334 -p 27335:24335 -p 27336:24336 IMAGE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace City | ||
{ | ||
public class NetworkConfiguration | ||
{ | ||
public string Identifier { get; set; } | ||
|
||
public string Chain { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public int Port { get; set; } | ||
|
||
public int RpcPort { get; set; } | ||
|
||
public int ApiPort { get; set; } | ||
|
||
public int WsPort { get; set; } | ||
|
||
} | ||
|
||
public class NetworkConfigurations | ||
{ | ||
private NetworkConfiguration[] networks; | ||
|
||
public NetworkConfigurations() | ||
{ | ||
networks = new NetworkConfiguration[] { | ||
|
||
new NetworkConfiguration() { | ||
Identifier = "main", | ||
Chain = "city", | ||
Name = "City Main", | ||
Port = 4333, | ||
RpcPort = 4334, | ||
ApiPort = 4335, | ||
WsPort = 4336 | ||
}, | ||
|
||
|
||
new NetworkConfiguration() { | ||
Identifier = "regtest", | ||
Chain = "city", | ||
Name = "City RegTest", | ||
Port = 14333, | ||
RpcPort = 14334, | ||
ApiPort = 14335, | ||
WsPort = 14336 | ||
}, | ||
|
||
new NetworkConfiguration() { | ||
Identifier = "testnet", | ||
Chain = "city", | ||
Name = "City Test", | ||
Port = 24333 , | ||
RpcPort = 24334, | ||
ApiPort = 24335, | ||
WsPort = 24336 | ||
}, | ||
|
||
|
||
}; | ||
|
||
} | ||
|
||
public NetworkConfiguration[] GetNetworks() | ||
{ | ||
return this.networks; | ||
} | ||
|
||
public NetworkConfiguration GetNetwork(string identifier, string chain) | ||
{ | ||
return this.networks.FirstOrDefault(n => n.Identifier == identifier && n.Chain == chain); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters