Skip to content

Commit

Permalink
feat(wip): replace localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
outSH committed Nov 16, 2023
1 parent 599d64a commit 5bb2c07
Show file tree
Hide file tree
Showing 143 changed files with 283 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class CarbonAccountingApp {
}

const addressInfo = httpApi.address() as AddressInfo;
const nodeApiHost = `http://localhost:${addressInfo.port}`;
const nodeApiHost = `http://127.0.0.1:${addressInfo.port}`;

const config = new Configuration({ basePath: nodeApiHost });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function lockBesuAssetReference(
assetRefID: string,
): Promise<void> {
await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "SEND",
Expand All @@ -31,7 +31,7 @@ export async function lockBesuAssetReference(

export async function getBesuBalance(address: string): Promise<number> {
const response = await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_CBDC_ERC20_NAME,
invocationType: "CALL",
Expand All @@ -54,7 +54,7 @@ export async function isBesuAssetReference(
assetRefID: string,
): Promise<boolean> {
const response = await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "CALL",
Expand All @@ -75,7 +75,7 @@ export async function isBesuAssetReference(

export async function resetBesu(): Promise<void> {
await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_CBDC_ERC20_NAME,
invocationType: "SEND",
Expand All @@ -98,7 +98,7 @@ export async function resetBesu(): Promise<void> {
);

await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "SEND",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const FABRIC_CONTRACT_ASSET_REF_NAME = "asset-reference-contract";

export async function getFabricBalance(identity: string): Promise<number> {
const response = await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_CBDC_ERC20_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -29,7 +29,7 @@ export async function readFabricAssetReference(
assetRefID: string,
): Promise<any> {
const response = await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -50,7 +50,7 @@ export async function fabricAssetReferenceExists(
assetRefID: string,
): Promise<string> {
const response = await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -72,7 +72,7 @@ export async function lockFabricAssetReference(
assetRefID: string,
): Promise<any> {
return axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -92,7 +92,7 @@ export async function deleteFabricAssetReference(
assetRefID: string,
): Promise<any> {
return axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -113,7 +113,7 @@ export async function refundFabricTokens(
finalUserEthAddress: string,
): Promise<any> {
return axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -130,7 +130,7 @@ export async function refundFabricTokens(

export async function resetFabric(): Promise<void> {
await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_CBDC_ERC20_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -145,7 +145,7 @@ export async function resetFabric(): Promise<void> {
);

await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Given(
"{string} with {int} CBDC available in the sidechain smart contract",
async function (user: string, amount: number) {
await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "SEND",
Expand All @@ -49,7 +49,7 @@ When(
"{string} escrows {int} CBDC and creates an asset reference with id {string} in the sidechain",
async function (user: string, amount: number, assetRefID: string) {
await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_CBDC_ERC20_NAME,
invocationType: "SEND",
Expand Down Expand Up @@ -82,7 +82,7 @@ When(
"bob deletes the asset reference with id {string} in the sidechain",
async function (assetRefID: string) {
await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "SEND",
Expand Down Expand Up @@ -125,7 +125,7 @@ Then(
"the asset reference with id {string} is locked in the sidechain",
async function (assetRefID: string) {
const response = await axios.post(
"http://localhost:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
"http://127.0.0.1:4100/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract",
{
contractName: BESU_CONTRACT_ASSET_REF_NAME,
invocationType: "CALL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Then(
};

const response = await axios.post(
"http://localhost:4100/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
"http://127.0.0.1:4100/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
{
clientGatewayConfiguration: {
apiHost: `http://localhost:4100`,
apiHost: `http://127.0.0.1:4100`,
},
serverGatewayConfiguration: {
apiHost: `http://localhost:4000`,
apiHost: `http://127.0.0.1:4000`,
},
version: "0.0.0",
loggingProfile: "dummyLoggingProfile",
Expand Down Expand Up @@ -92,13 +92,13 @@ Then(

await axios
.post(
"http://localhost:4100/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
"http://127.0.0.1:4100/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
{
clientGatewayConfiguration: {
apiHost: `http://localhost:4100`,
apiHost: `http://127.0.0.1:4100`,
},
serverGatewayConfiguration: {
apiHost: `http://localhost:4000`,
apiHost: `http://127.0.0.1:4000`,
},
version: "0.0.0",
loggingProfile: "dummyLoggingProfile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Then(
"the bridged out amount in the chaincode is {int} CBDC",
async function (amount: string) {
const response = await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand Down Expand Up @@ -55,13 +55,13 @@ When(
};

const response = await axios.post(
"http://localhost:4000/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
"http://127.0.0.1:4000/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
{
clientGatewayConfiguration: {
apiHost: `http://localhost:4000`,
apiHost: `http://127.0.0.1:4000`,
},
serverGatewayConfiguration: {
apiHost: `http://localhost:4100`,
apiHost: `http://127.0.0.1:4100`,
},
version: "0.0.0",
loggingProfile: "dummyLoggingProfile",
Expand Down Expand Up @@ -118,13 +118,13 @@ Then(

await axios
.post(
"http://localhost:4000/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
"http://127.0.0.1:4000/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest",
{
clientGatewayConfiguration: {
apiHost: `http://localhost:4000`,
apiHost: `http://127.0.0.1:4000`,
},
serverGatewayConfiguration: {
apiHost: `http://localhost:4100`,
apiHost: `http://127.0.0.1:4100`,
},
version: "0.0.0",
loggingProfile: "dummyLoggingProfile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Given(
"{string} with {int} CBDC available in the source chain",
async function (user: string, amount: number) {
await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_CBDC_ERC20_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand All @@ -51,7 +51,7 @@ When(
"{string} escrows {int} CBDC and creates an asset reference with id {string} in the source chain",
async function (user: string, amount: number, assetRefID: string) {
await axios.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_CBDC_ERC20_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand Down Expand Up @@ -98,7 +98,7 @@ Then(
async function (user: string, assetRefID: string) {
return axios
.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_ASSET_REF_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand Down Expand Up @@ -126,7 +126,7 @@ Then(

axios
.post(
"http://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
"http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction",
{
contractName: FABRIC_CONTRACT_CBDC_ERC20_NAME,
channelName: FABRIC_CHANNEL_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ export class SupplyChainApp {
const httpGuiC = await Servers.startOnPort(3200, "0.0.0.0");

const addressInfoA = httpApiA.address() as AddressInfo;
const nodeApiHostA = `http://localhost:${addressInfoA.port}`;
const nodeApiHostA = `http://127.0.0.1:${addressInfoA.port}`;

const addressInfoB = httpApiB.address() as AddressInfo;
const nodeApiHostB = `http://localhost:${addressInfoB.port}`;
const nodeApiHostB = `http://127.0.0.1:${addressInfoB.port}`;

const addressInfoC = httpApiC.address() as AddressInfo;
const nodeApiHostC = `http://localhost:${addressInfoC.port}`;
const nodeApiHostC = `http://127.0.0.1:${addressInfoC.port}`;

const token = await this.getOrCreateToken();
const baseOptions = { headers: { Authorization: `Bearer ${token}` } };
Expand Down Expand Up @@ -464,7 +464,7 @@ export class SupplyChainApp {
const memberIdA = uuidv4();
const nodeIdA = uuidv4();
const addressInfoA = serverA.address() as AddressInfo;
const nodeApiHostA = `http://localhost:${addressInfoA.port}`;
const nodeApiHostA = `http://127.0.0.1:${addressInfoA.port}`;

const publickKeyPemA = await exportSPKI(keyPairA);
const cactusNodeA: CactusNode = {
Expand Down Expand Up @@ -492,7 +492,7 @@ export class SupplyChainApp {
const memberIdB = uuidv4();
const nodeIdB = uuidv4();
const addressInfoB = serverB.address() as AddressInfo;
const nodeApiHostB = `http://localhost:${addressInfoB.port}`;
const nodeApiHostB = `http://127.0.0.1:${addressInfoB.port}`;

const publickKeyPemB = await exportSPKI(keyPairB);
const cactusNodeB: CactusNode = {
Expand Down Expand Up @@ -521,7 +521,7 @@ export class SupplyChainApp {
const memberIdC = uuidv4();
const nodeIdC = uuidv4();
const addressInfoC = serverC.address() as AddressInfo;
const nodeApiHostC = `http://localhost:${addressInfoC.port}`;
const nodeApiHostC = `http://127.0.0.1:${addressInfoC.port}`;

const publickKeyPemC = await exportSPKI(keyPairC);
const cactusNodeC: CactusNode = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ test(testCase, async (t: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ test(testCase, async (t: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server: server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test(testCase, async (t: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test(testCase, async (t: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test(testCase, async (t: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test("PluginObjectStoreIpfs", async (t1: Test) => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "localhost",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export class ConfigService {
const cockpitPort = (schema.cockpitPort as SchemaObj).default;

const pkiGenerator = new SelfSignedPkiGenerator();
const pkiServer: IPki = pkiGenerator.create("localhost");
const pkiServer: IPki = pkiGenerator.create("127.0.0.1");

const plugins: PluginImport[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test("NodeJS API server + Rust plugin work together", async (t: Test) => {
t.comment(`CactusKeychainVaultServer (Port=${hostPort}) started OK`);

const configuration = new Configuration({
basePath: `http://localhost:${hostPort}`,
basePath: `http://127.0.0.1:${hostPort}`,
});
const apiClient = new DefaultApi(configuration);

Expand Down
Loading

0 comments on commit 5bb2c07

Please sign in to comment.